package com.ykh.util;
import com.ykh.pojo.po.User;

//本地线程, 用于在 corntroller中直接获取用户信息
public class UserThreadLocal {
    //设置为单例
    private UserThreadLocal(){}

    private static final ThreadLocal<User> LOCAL = new ThreadLocal<>();

    public static void put(User sysUser){
        LOCAL.set(sysUser);
    }
    public static User get(){
        return LOCAL.get();
    }
    public static void remove(){
        LOCAL.remove();
    }
}